package com.hhkj.study.admin.config.excel;

import com.hhkj.study.admin.resource.excel.BaseExcelRes;
import com.ruoyi.common.annotation.Excel;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author luowu
 * @Date 2024/9/12 涵 14:14:42
 */
@Data
public class ConfigWelcomeExcelRes extends BaseExcelRes {

    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空")
    @Excel(name = "标题", width = 15, needMerge = true, require = true)
    private String title;
    /**
     * 内容
     */
    @NotBlank(message = "内容不能为空")
    @Excel(name = "内容", width = 15, needMerge = true, require = true)
    private String content;

    /**
     * 是否展示（0-上架， 1-下架）
     */
    @NotNull(message = "是否上架不能为空")
    @Excel(name = "是否上架", width = 15, needMerge = true, readConverterExp = "0=否,1=是", combo = {"是","否"}, require = true)
    private Integer publishedFlag;

    @Override
    public String getTitle() {
        return "宣传语导入模板\n" +
                "1、表头红色加粗为必填字段";
    }

    @Override
    public String getSheetName() {
        return "宣传语导入模板";
    }
}
